package com.begin.core.context;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * 输出web系统的根目录
 */
public class WebRootTag extends TagSupport {

	public int doStartTag() throws JspTagException {
		JspWriter out = pageContext.getOut();
		try {
			
			out.print(SystemInfo.getContextPath());
		} catch (Exception ex) {
			throw new JspTagException("IOError:" + ex.getMessage());
		}
		return Tag.SKIP_BODY;
	}

	public int doEndTag() throws JspTagException {
		return Tag.EVAL_PAGE;
	}
}
